// 用于主页面通用内容
import Main from '@/views/main.vue';
// 用于二级页面的内容
import SubMain from '@/views/sub-main.vue';

export default {
	path: '/order',
	name: 'order',
	redirect: '/order/retail/order',
	meta: {
		title: '订单',
		icon: 'md-list-box'
	},
    component: Main,
    children: [
    	{
			path: 'retail',
			name: 'order_retail',
			meta: {
				title: '零售'
			},
			component: SubMain,
			children: [
				{
					path: 'order',
					name: 'order_retail_order_index',
					meta: {
						title: '销售单查询',
						cache: true
					},
					component: resolve => {
						require(['@/views/order/retail/order/index.vue'], resolve)
					}
				},
				{
					path: 'orderDetail',
					name: 'order_retail_order_detail',
					meta: {
						title: '销售单详情',
						active: 'order_retail_order_index'
					},
					component: resolve => {
						require(['@/views/order/retail/order/detail.vue'], resolve)
					}
				},
				{
					path: 'express-bill',
					name: 'order_retail_expressBill',
					meta: {
						title: '快递单打印'
					},
					component: resolve => {
						require(['@/views/order/retail/express-bill/index.vue'], resolve)
					}
				},
				{
					path: 'service',
					name: 'order_retail_service_index',
					meta: {
						title: '售后单管理',
						cache: true
					},
					component: resolve => {
						require(['@/views/order/retail/service/index.vue'], resolve)
					}
				},
				{
					path: 'serviceDetail',
					name: 'order_retail_service_detail',
					meta: {
						title: '售后单详情',
						active: 'order_retail_service_index'
					},
					component: resolve => {
						require(['@/views/order/retail/service/detail.vue'], resolve)
					}
				},
				{
					path: 'evaluate',
					name: 'order_retail_evaluate',
					meta: {
						title: '评价管理',
						cache: true
					},
					component: resolve => {
						require(['@/views/order/retail/evaluate/index.vue'], resolve)
					}
				}
			]
		},
		{
			path: 'purchase',
			name: 'order_purchase',
			meta: {
				title: '采购'
			},
			component: SubMain,
			children: [
				{
					path: 'reserve',
					name: 'order_purchase_reserve_index',
					meta: {
						title: '订货单管理',
						disabled: true,
						cache: true
					},
					component: resolve => {
						require(['@/views/order/purchase/reserve/index.vue'], resolve)
					}
				},
				{
					path: 'entry',
					name: 'order_purchase_entry_index',
					meta: {
						title: '入库单管理',
						disabled: true,
						cache: true
					},
					component: resolve => {
						require(['@/views/order/purchase/entry/index.vue'], resolve)
					}
				},
				{
					path: 'return',
					name: 'order_purchase_return_index',
					meta: {
						title: '退货单管理',
						disabled: true,
						cache: true
					},
					component: resolve => {
						require(['@/views/order/purchase/return/index.vue'], resolve)
					}
				}
			]
		},
		{
			path: 'wholesale',
			name: 'order_wholesale',
			meta: {
				title: '批发'
			},
			component: SubMain,
			children: [
				{
					path: 'batch',
					name: 'order_wholesale_batch_index',
					meta: {
						title: '批发单管理',
						disabled: true,
						cache: true
					},
					component: resolve => {
						require(['@/views/order/wholesale/batch/index.vue'], resolve)
					}
				},
				{
					path: 'out',
					name: 'order_wholesale_out_index',
					meta: {
						title: '入库单管理',
						disabled: true,
						cache: true
					},
					component: resolve => {
						require(['@/views/order/wholesale/out/index.vue'], resolve)
					}
				},
				{
					path: 'return',
					name: 'order_wholesale_return_index',
					meta: {
						title: '退货单管理',
						disabled: true,
						cache: true
					},
					component: resolve => {
						require(['@/views/order/wholesale/return/index.vue'], resolve)
					}
				}
			]
		},
		{
			path: 'bill',
			name: 'order_bill',
			meta: {
				divider: true
			},
			component: SubMain,
			children: [
				{
					path: 'allot',
					name: 'order_bill_allot_index',
					meta: {
						title: '调拨单管理',
						disabled: true,
						cache: true
					},
					component: resolve => {
						require(['@/views/order/bill/allot/index.vue'], resolve)
					}
				},
				{
					path: 'deposit',
					name: 'order_bill_deposit_index',
					meta: {
						title: '寄存单管理',
						disabled: true,
						cache: true
					},
					component: resolve => {
						require(['@/views/order/bill/deposit/index.vue'], resolve)
					}
				}
			]
		}
    ]
}